import http from '/@lib/utils/http/request'
import { DictTypeForm, DictTypeQuery, DictTypeVO } from '/@/api/system/dict/type/types.ts'


export const DictTypeApi: any = {};

// 查询字典类型列表
DictTypeApi.page = (query: DictTypeQuery) => {
  return http.get<DictTypeVO[]>("/system/dict/type/page", query);
};

// 查询字典类型列表
DictTypeApi.list = (query: DictTypeQuery) => {
  return http.get<DictTypeVO[]>("/system/dict/type/list", query);
};

// 查询字典类型详细
DictTypeApi.getInfo = (dictId: number | string) => {
  return http.get<DictTypeVO>("/system/dict/type/getInfo" + dictId);
};

// 新增字典类型
DictTypeApi.add = (data: DictTypeForm) => {
  return http.post("/system/dict/type/add", data);
};

// 修改字典类型
DictTypeApi.update = (data: DictTypeForm) => {
  return http.post("/system/dict/type/update", data);
};

// 删除字典类型
DictTypeApi.delete = (id: string | number | Array<string | number>) => {
  return http.post("/system/dict/type/delete/" + id);
};

// 获取字典选择框列表
DictTypeApi.optionSelect = () => {
  return http.get<DictTypeVO[]>("/system/dict/type/optionSelect");
};


// 刷新字典缓存
// export function refreshCache() {
//   return request({
//     url: "/system/dict/type/refreshCache",
//     method: "delete"
//   });
// }


